// gu:
function ajax(type,url,data,func)
{
  $.ajax({ type: type, url: url, data: data,success: func });
}

function ajax2(type,url,data)
{
  $.ajax({ type: type, url: url, data: data});
}

function ajax3(type,url,data)
{
  $.ajax({ type: type, url: url, data: data,success:function(res){
      alert("done");
      location.reload(true);
    }
  });
}

      
// for video:
function loadMe(vid,eid,w,h,isC){
  var params = { allowScriptAccess: "always" };
  var atts = { id: eid };
  
  vUrl = "http://www.youtube.com/v/" + vid + "?enablejsapi=1&playerapiid=ytplayer";
  if(isC)
    vUrl = "http://www.youtube.com/apiplayer?enablejsapi=1&version=3";
  
  swfobject.embedSWF(vUrl, 
                     eid, w, h, "8", null, null, params, atts);
}

// return the location of the curser in the element(textarea, input ext.).
// exteranal :http://stackoverflow.com/questions/263743/how-to-get-cursor-position-in-textarea
  function getCaret(el) { 
    if (el.selectionStart) { 
      return el.selectionStart; 
    } else if (document.selection) { 
      el.focus(); 
  
      var r = document.selection.createRange(); 
      if (r == null) { 
        return 0; 
      } 
  
      var re = el.createTextRange(), 
          rc = re.duplicate(); 
      re.moveToBookmark(r.getBookmark()); 
      rc.setEndPoint('EndToStart', re); 
  
      return rc.text.length; 
    }  
    return 0; 
  }